#include "FinanceUser.h"

FinanceUser::FinanceUser()
{
}

FinanceUser::~FinanceUser()
{
}

void FinanceUser::link(BookingClass* i, Holiday* j, Management* k)
{
    bc = i;
    hol = j;
    mg = k;
}

void FinanceUser::menu(string username)
{
    cout << "Welcome Finance Officer " << username << " !" << endl
            << "==================================================" << endl << endl;

    bool isExit = false;
    do
    {
        cout << "Please select desired option" << endl << endl
                << "1) Manage Approved Bookings" << endl
                << "2) Manage Cancelled Bookings" << endl
                << "3) Logout" << endl << endl
                << "Your Option: ";

        int opt;
        cin >> opt;
        cin.clear();
        cin.ignore(INT_MAX, '\n');

        switch (opt)
        {
        case 1: option1();
            break;
        case 2: option2();
            break;
        case 3: isExit = true;
            break;
        default: cout << "Enter only 1-3 please." << endl;
            break;
        }
    }
    while (isExit == false);
}

void FinanceUser::option1()
{
    cout << endl << "You have selected to manage Approved Bookings." << endl << endl;
    bc->checkApprovedBookings();
}

void FinanceUser::option2()
{
    cout << endl << "You have selected to manage Cancelled Bookings." << endl << endl;
    bc->checkCancelledBookings();
}